from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import ListAPIView
from apps.meiduo_admin.serializers.options import SpecsOptinosSerializer, GoodsSpecsSimpleSerializer
from apps.meiduo_admin.utils.pagination import MeiduoPagination
from apps.goods.models import SpecificationOption, SPUSpecification


#规格选项表管理
class SpecsOptionsViewSet(ModelViewSet):
    queryset = SpecificationOption.objects.all()
    serializer_class = SpecsOptinosSerializer
    pagination_class = MeiduoPagination

#规格选项表里面的 获取品牌的信息
class GoodsSpecsSimpleView(ListAPIView):
    queryset = SPUSpecification.objects.all().order_by('-id')
    serializer_class = GoodsSpecsSimpleSerializer